#include<stdio.h>

int main()
{
	int x, n, i, k, flag = 1;
	scanf("%d", &n);
	k = 0;
	for (i = 1; i <= n; i++)
	{
		scanf("%d", &x);
		x = x - k;
		if (x < 0)
			flag = 0;
		k = x % 2;
	}
	if (k != 0)
		flag = 0;
	if (flag == 1)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}
